/**
 * 
 */
package model.world.tile;

import model.world.Chunk;

/**
 * @author Justin
 *
 */
public enum ResourceType {
	NULL(-1, 0),
	BOG(0, .05),
	WOOD(1, .3),
	STONE(2, .025),
	FIELD(3, 1);
	
	private final int id;
	private final double p;
	
	ResourceType(int id, double p){
		this.id = id;
		this.p = p;
	}
	
	public int toInt(){
		return id;
	}
	
	public double getProbability(){
		return p;
	}
	
	public Tile makeNew(long x, long y, Chunk parentChunk){
		switch(id){
		case 0:
			return new BogTile(x, y, parentChunk);
		case 1:
			return new WoodTile(x, y, parentChunk);
		case 2:
			return new StoneTile(x, y, parentChunk);
		case 3:
			return new FieldTile(x, y, parentChunk);
		default:
			return null;
		}
	}
}
